<%@ Page Language="C#" AutoEventWireup="true" CodeFile="RespPerson.aspx.cs" Inherits="RespPerson" culture="auto" uiculture="auto" meta:resourcekey="PageResource1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
	<title>Untitled Page</title>
	<base target="_self" />
	<link href="ip.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
        <div>
            <asp:ObjectDataSource ID="ODSRespPersons" runat="server"
					OldValuesParameterFormatString="original_{0}" 
					SelectMethod="GetsProjectSupervisor"
					TypeName="ClassLibrary.BusinessLayer.Facade.ProjectSupervisorFacade" 
					OnSelecting="ODSRespPersons_Selecting">
                <SelectParameters>
                    <asp:Parameter Name="SPName" Type="String" />
                    <asp:Parameter Name="param" Type="Object" />
                </SelectParameters>
            </asp:ObjectDataSource>
            <asp:ObjectDataSource ID="ODSUsers" runat="server" OldValuesParameterFormatString="original_{0}"
                SelectMethod="GetResponsiblePersonsFromUsersData" TypeName="IPTableAdapters.dtRespPersonsFromUsersTableAdapter" OnSelecting="ODSUsers_Selecting">
                <SelectParameters>
                    <asp:SessionParameter Name="OwnerGroupID" SessionField="OwnerGroupID" Type="String" />
                </SelectParameters>
            </asp:ObjectDataSource>
            <asp:ObjectDataSource ID="ODSRespPerson2" runat="server" DeleteMethod="Delete" InsertMethod="Insert"
                OldValuesParameterFormatString="original_{0}" SelectMethod="GetRespPersonsData"
                TypeName="IPTableAdapters.ProjectSupervisorTableAdapter">
                <DeleteParameters>
                    <asp:Parameter Name="ProjectCode" Type="String" />
                    <asp:Parameter Name="ResponsiblePerson" Type="String" />
                </DeleteParameters>
                <SelectParameters>
                    <asp:SessionParameter Name="ProjectCode" SessionField="ProjectCode" Type="String" />
                </SelectParameters>
                <InsertParameters>
                    <asp:Parameter Name="ProjectCode" Type="String" />
                    <asp:Parameter Name="ResponsiblePerson" Type="String" />
                    <asp:Parameter Name="CreateBy" Type="String" />
                    <asp:Parameter Name="UpdateBy" Type="String" />
                    <asp:Parameter Name="OwnerGroupID" Type="String" />
                </InsertParameters>
            </asp:ObjectDataSource>
            <asp:Panel ID="Panel1" runat="server">
               <fieldset>
                    <asp:Panel ID="Panel2" runat="server">
						<asp:GridView ID="gvRespPersons" runat="server" 
								AllowSorting="True" 
								AutoGenerateColumns="False"
								BackColor="#DEBA84" 
								BorderColor="#660000" 
								BorderStyle="None" 
								BorderWidth="1px"
								CellPadding="0" 
								CellSpacing="0" 
								CssClass="Grid" 
								DataKeyNames="ProjectCode,ResponsiblePerson"
								DataSourceID="ODSRespPersons" 
								EmptyDataText="No Responsible Persons record(s) available."
								OnSelectedIndexChanged="gvRespPersons_SelectedIndexChanged" 
								OnRowCreated="gvRespPersons_RowCreated">
							<Columns>
								<asp:BoundField DataField="ProjectCode" HeaderText="ProjectCode" meta:resourcekey="BoundFieldResource1" ReadOnly="True" SortExpression="ProjectCode" Visible="False" />
								<asp:ButtonField CommandName="Select" DataTextField="ResponsiblePerson" HeaderText="Responsible Persons" meta:resourcekey="ButtonFieldResource1" SortExpression="ResponsiblePerson"/>
								<asp:BoundField DataField="ResponsiblePerson" HeaderText="Responsible Persons" meta:resourcekey="BoundFieldResource2" ReadOnly="True" SortExpression="ResponsiblePerson" Visible="False" />
								<asp:BoundField DataField="CreateBy" HeaderText="CreateBy" meta:resourcekey="BoundFieldResource3" SortExpression="CreateBy" Visible="False" />
								<asp:BoundField DataField="UpdateBy" HeaderText="UpdateBy" meta:resourcekey="BoundFieldResource4" SortExpression="UpdateBy" Visible="False" />
								<asp:BoundField DataField="OwnerGroupID" HeaderText="OwnerGroupID" meta:resourcekey="BoundFieldResource5" SortExpression="OwnerGroupID" Visible="False" />
							</Columns>
							<HeaderStyle CssClass="GridHeaderStyle" ForeColor="White" />
							<RowStyle CssClass="GridRowStyle"/>
							<AlternatingRowStyle CssClass="GridAltRowStyle" />
							<SelectedRowStyle CssClass="GridAltRowStyle"/>
							<PagerStyle CssClass="GridPagerStyle" ForeColor="White"/>
							<FooterStyle CssClass="GridFooterStyle" ForeColor="White" />
						</asp:GridView>
					</asp:Panel>
                    <table>
                        <tr>
                            <td>
                                <asp:Label ID="lblRespPerson" Text="Responsible Person" meta:resourcekey="lblRespPersonResource1" runat="server"/>
                            </td>
                            <td>
                                <asp:DropDownList ID="ddlRespPerson" runat="server" DataSourceID="ODSUsers" DataTextField="UserName" DataValueField="UserName" meta:resourcekey="ddlRespPersonResource1" Width="345px"/>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2" style="text-align: center">
                                <asp:Button ID="btnNew" runat="server" CausesValidation="False" CssClass="submit" meta:resourcekey="btnNewResource1" OnClick="btnNew_Click" Text="New" />
                                <asp:Button ID="btnModify" runat="server" CausesValidation="False" CssClass="submit" meta:resourcekey="btnModifyResource1" OnClick="btnModify_Click" Text="Edit" Visible="False" />
                                <asp:Button ID="btnSave" runat="server" CssClass="submit" meta:resourcekey="btnSaveResource1" OnClick="btnSave_Click" Text="Save" />
                                <asp:Button ID="btnDelete" runat="server" CausesValidation="False" CssClass="submit" meta:resourcekey="btnDeleteResource1" OnClick="btnDelete_Click" Text="Delete" />
                                <asp:Button ID="btnCancel" runat="server" CausesValidation="False" CssClass="reset" meta:resourcekey="btnCancelResource1" OnClick="btnCancel_Click" Text="Cancel" />
                            </td>
                        </tr>
						<tr>
							<td colspan="2">
								<asp:Label ID="lblError" CssClass="error" runat="server"/>
							</td>
						</tr>
                    </table>
                </fieldset>
            </asp:Panel>
        </div>
    </form>
</body>
</html>
